TermsModal.tsx ➔ TermsModal   A
last analyzed

Complexity

Conditions 3

Size

Total Lines 41
Code Lines 34

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 34
dl 0
loc 41
rs 9.064
c 0
b 0
f 0
cc 3
1
import React from 'react';
2
import { useState, useEffect } from 'react';
3
import { StyleSheet, Text, View, Pressable, Modal, TextInput, ScrollView} from 'react-native';
4
import Icon from 'react-native-vector-icons/Octicons';
5
6
7
export default function TermsModal({navigation, modalVisible, setModalVisible, termsVisible}) {
8
    const [text, setText] = useState(null);
9
10
    useEffect(() => {
11
        function getText(): void {
12
            // Determine what text file to display
13
            (termsVisible) ? setText(terms_conditions) : setText(privacy_policy);            
14
        };
15
16
        getText();
17
    })
18
19
20
    return (
21
        <Modal
22
        animationType='fade'
23
        transparent={true}
24
        visible={modalVisible}
25
        onRequestClose={() => {
26
            setModalVisible(!modalVisible);
27
        }}
28
        >
29
            <View style={styles.modalContainer}>
30
31
                <View style={[styles.messageContainer, styles.shadowProp]}>
32
                    <Pressable style={[styles.backButton, styles.shadowProp]} onPress={() => setModalVisible(!modalVisible)}>
33
                    <Icon 
34
                        name='x' 
35
                        size={20} 
36
                        color='black'
37
                    />
38
                    </Pressable>
39
                    <ScrollView style={styles.textContainer}>
40
                        <Text> {text} </Text>
41
                    </ScrollView>
42
                    
43
                </View>
44
            </View>
45
        </Modal>
46
    )
47
}
48
49
const styles = StyleSheet.create({
50
    modalContainer: {
51
        height: '100%', 
52
        width: '100%', 
53
        backgroundColor: 'rgba(0, 0, 0, 0.8)', 
54
        position:'absolute',
55
        justifyContent: 'center',
56
        alignItems: 'center'
57
    },
58
59
    messageContainer: {
60
        backgroundColor: 'white',
61
        width: '90%',
62
        height: '90%',
63
        justifyContent: 'center',
64
        alignItems: 'center'
65
    },
66
67
    shadowProp: {
68
        elevation: 5,
69
        shadowColor: 'black'
70
    },
71
72
    title: {
73
        fontSize: 18,
74
        fontWeight: '600',
75
        color: 'white',
76
        textAlign: 'left',
77
        width: '80%',
78
        marginTop: 20
79
    },
80
81
    prepaidButton: {
82
        backgroundColor: 'black',
83
        width: '90%',
84
        height: 50,
85
        borderRadius: 50,
86
        display: 'flex',
87
        justifyContent: 'center',
88
        alignItems: 'center',
89
        marginTop: 30,
90
    },
91
92
    text: {
93
        textAlign: 'left',
94
        width: '100%',
95
        fontSize: 16
96
    },
97
98
    textContainer: {
99
        width: '90%',
100
        marginTop: 10,
101
        marginBottom: 10
102
    },
103
    
104
    backButton: {
105
        position: 'absolute',
106
        width: 30,
107
        height: 30, 
108
        left: -15,
109
        backgroundColor: 'white',
110
        top: -15,
111
        borderRadius: 25,
112
        borderWidth: 1,
113
        borderColor: 'gray',
114
        alignItems: 'center',
115
        justifyContent: 'center',
116
        zIndex: 1
117
    },
118
})
119
120
const privacy_policy = `
121
122
Privacy Policy
123
SparkRentals AB built the SparkRentals app as an Open Source app. This SERVICE is provided by SparkRentals AB at no cost and is intended for use as is.
124
125
This page is used to inform visitors regarding our policies with the collection, use, and disclosure of Personal Information if anyone decided to use our Service.
126
127
If you choose to use our Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that we collect is used for providing and improving the Service. We will not use or share your information with anyone except as described in this Privacy Policy.
128
129
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at SparkRentals unless otherwise defined in this Privacy Policy.
130
131
Information Collection and Use
132
133
For a better experience, while using our Service, we may require you to provide us with certain personally identifiable information. The information that we request will be retained by us and used as described in this privacy policy.
134
135
The app does use third-party services that may collect information used to identify you.
136
137
Link to the privacy policy of third-party service providers used by the app
138
139
Google Play Services
140
Facebook
141
Expo
142
Log Data
143
144
We want to inform you that whenever you use our Service, in a case of an error in the app we collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing our Service, the time and date of your use of the Service, and other statistics.
145
146
Cookies
147
148
Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.
149
150
This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
151
152
Service Providers
153
154
We may employ third-party companies and individuals due to the following reasons:
155
156
To facilitate our Service;
157
To provide the Service on our behalf;
158
To perform Service-related services; or
159
To assist us in analyzing how our Service is used.
160
We want to inform users of this Service that these third parties have access to their Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
161
162
Security
163
164
We value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and we cannot guarantee its absolute security.
165
166
Links to Other Sites
167
168
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by us. Therefore, we strongly advise you to review the Privacy Policy of these websites. We have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
169
170
Children’s Privacy
171
172
These Services do not address anyone under the age of 13. We do not knowingly collect personally identifiable information from children under 13 years of age. In the case we discover that a child under 13 has provided us with personal information, we immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact us so that we will be able to do the necessary actions.
173
174
Changes to This Privacy Policy
175
176
We may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. We will notify you of any changes by posting the new Privacy Policy on this page.
177
178
This policy is effective as of 2022-11-01
179
180
Contact Us
181
182
If you have any questions or suggestions about our Privacy Policy, do not hesitate to contact us at [email protected].
183
184
This privacy policy page was created at privacypolicytemplate.net and modified/generated by App Privacy Policy Generator
185
`;
186
187
const terms_conditions = `
188
Terms & Conditions
189
By downloading or using the app, these terms will automatically apply to you – you should make sure therefore that you read them carefully before using the app. You’re not allowed to copy or modify the app, any part of the app, or our trademarks in any way. You’re not allowed to attempt to extract the source code of the app, and you also shouldn’t try to translate the app into other languages or make derivative versions. The app itself, and all the trademarks, copyright, database rights, and other intellectual property rights related to it, still belong to SparkRentals AB.
190
191
SparkRentals AB is committed to ensuring that the app is as useful and efficient as possible. For that reason, we reserve the right to make changes to the app or to charge for its services, at any time and for any reason. We will never charge you for the app or its services without making it very clear to you exactly what you’re paying for.
192
193
The SparkRentals app stores and processes personal data that you have provided to us, to provide our Service. It’s your responsibility to keep your phone and access to the app secure. We therefore recommend that you do not jailbreak or root your phone, which is the process of removing software restrictions and limitations imposed by the official operating system of your device. It could make your phone vulnerable to malware/viruses/malicious programs, compromise your phone’s security features and it could mean that the SparkRentals app won’t work properly or at all.
194
195
The app does use third-party services that declare their Terms and Conditions.
196
197
Link to Terms and Conditions of third-party service providers used by the app
198
199
Google Play Services
200
Facebook
201
Expo
202
You should be aware that there are certain things that SparkRentals AB will not take responsibility for. Certain functions of the app will require the app to have an active internet connection. The connection can be Wi-Fi or provided by your mobile network provider, but SparkRentals AB cannot take responsibility for the app not working at full functionality if you don’t have access to Wi-Fi, and you don’t have any of your data allowance left.
203
204
If you’re using the app outside of an area with Wi-Fi, you should remember that the terms of the agreement with your mobile network provider will still apply. As a result, you may be charged by your mobile provider for the cost of data for the duration of the connection while accessing the app, or other third-party charges. In using the app, you’re accepting responsibility for any such charges, including roaming data charges if you use the app outside of your home territory (i.e. region or country) without turning off data roaming. If you are not the bill payer for the device on which you’re using the app, please be aware that we assume that you have received permission from the bill payer for using the app.
205
206
Along the same lines, SparkRentals AB cannot always take responsibility for the way you use the app i.e. You need to make sure that your device stays charged – if it runs out of battery and you can’t turn it on to avail the Service, SparkRentals AB cannot accept responsibility.
207
208
With respect to SparkRentals AB’s responsibility for your use of the app, when you’re using the app, it’s important to bear in mind that although we endeavor to ensure that it is updated and correct at all times, we do rely on third parties to provide information to us so that we can make it available to you. SparkRentals AB accepts no liability for any loss, direct or indirect, you experience as a result of relying wholly on this functionality of the app.
209
210
At some point, we may wish to update the app. The app is currently available on Android & iOS – the requirements for the both systems(and for any additional systems we decide to extend the availability of the app to) may change, and you’ll need to download the updates if you want to keep using the app. SparkRentals AB does not promise that it will always update the app so that it is relevant to you and/or works with the Android & iOS version that you have installed on your device. However, you promise to always accept updates to the application when offered to you, We may also wish to stop providing the app, and may terminate use of it at any time without giving notice of termination to you. Unless we tell you otherwise, upon any termination, (a) the rights and licenses granted to you in these terms will end; (b) you must stop using the app, and (if needed) delete it from your device.
211
212
Changes to This Terms and Conditions
213
214
We may update our Terms and Conditions from time to time. Thus, you are advised to review this page periodically for any changes. We will notify you of any changes by posting the new Terms and Conditions on this page.
215
216
These terms and conditions are effective as of 2022-11-01
217
218
Contact Us
219
220
If you have any questions or suggestions about our Terms and Conditions, do not hesitate to contact us at [email protected].
221
222
This Terms and Conditions page was generated by App Privacy Policy Generator
223
`